Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Benjamin Buchmuller via ntg-context
} > > \let\stopMyCommand\relax > > \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 > stopMyCommand}% > {\endgroup > % whatever #1 does > \setbuffer[foo]#2\endbuffer > \typebuffer[foo] > \getbuffer[foo]} > > or >

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Hans Hagen via ntg-context
[#1]% {\begingroup \setcatcodetable\notcatcodes \dostartMyCommand[#1]} \let\stopMyCommand\relax \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 stopMyCommand}% {\endgroup % whatever #1 does \setbuffer[foo]#2\endbuffer \typebuffer[foo] \getbuffer

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Benjamin Buchmuller via ntg-context
; these useful features? > buffers are stored as-is so no catcode magic stored, contrary to macros > > you can use \setbuffer but that doesn't solve the argument passing > > however, you can nest buffers so you can make other \start\stop commands > buffers too and then do

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Hans Hagen via ntg-context
was wondering how I should define or expand #2 in the MWE below to make TeX happily accept these useful features? buffers are stored as-is so no catcode magic stored, contrary to macros you can use \setbuffer but that doesn't solve the argument passing however, you can nest buffers so you can make

Re: [NTG-context] LMTX deeptextcommand issue

2019-04-02 Thread Hans Hagen
\fi \else \let \currentreg... l.25 } ...l.11633 \stop 15 16 \registerctxluafile{page-run}{} 17 18 \unprotect 19 20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print} 21 22 \gdef\page_layouts_show_print[#1][#2][#3]% only english 23

[NTG-context] LMTX deeptextcommand issue

2019-04-02 Thread Jan Tosovsky
age-run}{} 17 18 \unprotect 19 20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print} 21 22 \gdef\page_layouts_show_print[#1][#2][#3]% only english 23 {\setbuffer[crap]% 24 \unprotect 25 >> \definepapersize[X][\c!w

Re: [NTG-context] Buffer within a \def

2018-08-10 Thread Wolfgang Schuster
\getbuffer[Buf] } \def\T {\setbuffer[Buf]a b ccc d e f\endbuffer \getbuffer[Buf]} Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http

Re: [NTG-context] add to \setbuffer

2018-01-10 Thread Hans Hagen
On 1/10/2018 6:30 PM, Wolfgang Schuster wrote: dr. Hans van der Meer <mailto:havdm...@ziggo.nl> 10. Januar 2018 um 13:45 With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a

Re: [NTG-context] add to \setbuffer

2018-01-10 Thread Wolfgang Schuster
dr. Hans van der Meer <mailto:havdm...@ziggo.nl> 10. Januar 2018 um 13:45 With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a later moment? You can use the “buffers.

[NTG-context] add to \setbuffer

2018-01-10 Thread dr. Hans van der Meer
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a later moment? Hans van der Meer ___ If your question

Re: [NTG-context] letters in context mkiv

2017-07-31 Thread r . ermers
with alternatives like \startbuffer[lettercontent] … endbuffer. The \input problem remains: it appears that the buffer takes any command (\foo) as literal text.I tried moving the setbuffer … endbuffer part to elswhere in the document. I also experimented with \input a sample text of my own on my

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
rnalfilter@set_filenames \setbuffer[\externalfilter@buffer_name]#3\endbuffer \externalfilter@process_filter \stoptexdefinition \protect \defineexternalfilter [ASY] [ filtercommand={asy -tex context \externalfilterinputfile\space -o \externalfilteroutputfil

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Aditya Mahajan
\externalfiter@set_indeed} \starttexdefinition externalfiter@set_indeed [#1][#2]#3 % #1 = filter % #2 = options \begingroup \edef\currentexternalfilter{#1} \setupexternalfilter[#1][\c!name=,#2] \externalfilter@set_filenames \setbuffer[\externalfilter@buffer_name]#3\endbuffer

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
] [ filtercommand={asy -tex context \externalfilterinputfile\space -o \externalfilteroutputfile}, output=\externalfilterbasefile.pdf, purge=no, cache=yes, readcommand=\ReadImage, ] \define[1]\ReadImage{\externalfigure[#1]} \define[1]\mycircle{ #1 - XXX \setbuffer[ASY] import

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-21 Thread Aditya Mahajan
[MARKDOWN] [ filtercommand={pandoc -f markdown -t context \externalfilterinputfile\space -o \externalfilteroutputfile}, cache=yes, purge=no, % Just for testing. May be removed. ] \define[1]\TEST {\setbuffer[MARKDOWN]This is #1\endbuffer \processMARKDOWNbuffer

Re: [NTG-context] buffering inside xmlsetups

2016-10-11 Thread Wolfgang Schuster
llowed by . The getbuffer setup is not even reached, as is obvious. I tried \xmltofile to put the data into an intermediate file, but to no avail because it produces the following, leading at best to recursion when processed by \xmlprocessfile. bufferdata Is there a solution to this? \set

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Erik Margraf
März 2016 um 10:11 > > > \startbuffer .. \stopbuffer is parsed special > > so use: > > \def\Buffer#1#2 > {\setbuffer[#1]{\input #2\relax}} > > \def\Buffer#1#2% > {\setbuffer[#1]\input{#2}\endbuffer} > > Wolfgang > > > ___

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Wolfgang Schuster
Hans Hagen <mailto:pra...@wxs.nl> 30. März 2016 um 10:11 \startbuffer .. \stopbuffer is parsed special so use: \def\Buffer#1#2 {\setbuffer[#1]{\input #2\relax}} \def\Buffer#1#2% {\setbuffer[#1]\input{#2}\endbuffer} Wo

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Erik Margraf
nuth} >> >> >> \stoptext >> >> - >> >> >> Context gives me the following error on this: >> >> >> tex error > tex error on line 9 in file >> C:/Users/emargraf/Documents/buffer.tex: ! Undefined cont

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Hans Hagen
use: \def\Buffer#1#2 {\setbuffer[#1]{\input #2\relax}} \Buffer{bla}{knuth} but i'm not sure what you gain here as it will still input tufte each time Hans - Hans Hagen | PRAGMA

Re: [NTG-context] Reprocessing part of input

2016-02-02 Thread Hans Hagen
... \stopmyinput \stopbuffer but now not executed at once, but stored in and executable from a buffer with \getbuffer[mystoragebuffer]. \setbuffer[foo]bar\endbuffer But of course there might be a better way to execute the same code more than once within one run of TeX. for that to answer

[NTG-context] mathvariant bold NOT bold-italic

2013-06-16 Thread Steffen Wolfrum
Hi, as far as I have understood MathML, elements tagged with mathvariant=bold should be set upright bold, not bold-italic. Could this be corrected, please? Thank you very much! Steffen --- \usemodule[mathml] \starttext \placeformula\startformula[9pt] \setbuffer mml:math xmlns:mml=http

[NTG-context] mathml linebreak?

2013-06-09 Thread Steffen Wolfrum
Hi, usually it is possible to break long formulas. But is there a way to do so, when formula is coded in mathml (see example below)? Thanks, Steffen --- \placeformula\startformula[9pt] \setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML; msub xmlns=http://www.w3.org/1998

[NTG-context] math guru wanted

2013-06-09 Thread Steffen Wolfrum
6 \usemodule[mathml] \starttext 7 8 9 \setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML; 10 mi xmlns=http://www.w3.org/1998/Math/MathML; mathvariant=bolda/mi 11 mo xmlns=http://www.w3.org/1998/Math/MathML;∈/mo 12 mi xmlns=http://www.w3.org/1998/Math

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Wolfgang Schuster
Am 08.06.2013 um 12:53 schrieb Steffen Wolfrum cont...@st.estfiles.de: Hi friends, we need to run MathML inside \sym (see below). Is there a way to solve the error ! Argument of \buff_gobble has an extra }. You can’t use \startbuffer … \stopbuffer in other commands but with \setbuffer

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Steffen Wolfrum
\startbuffer … \stopbuffer in other commands but with \setbuffer there is a command which can be used here. \sym{\setbuffer … \endbuffer\processxmlbuffer} great, thanks. but this immediately gives the next error: invalid xml file - parsed text what's wrong with the code below? Steffen

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Wolfgang Schuster
the error ! Argument of \buff_gobble has an extra }. You can’t use \startbuffer … \stopbuffer in other commands but with \setbuffer there is a command which can be used here. \sym{\setbuffer … \endbuffer\processxmlbuffer} great, thanks. but this immediately gives the next error: invalid

[NTG-context] mathvariant bold

2013-06-08 Thread Steffen Wolfrum
Hi, any idea, how to get it mi mathvariant=boldp/mi typeset in bold?? Steffen --- \usemodule[mathml] \starttext \placeformula\startformula[9pt] \setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML; mi xmlns=http://www.w3.org/1998/Math/MathML;π/mi mo xmlns=http://www.w3

Re: [NTG-context] buffer broken?

2012-01-11 Thread luigi scarso
[abc] whatever \stopbuffer Now I get: ! Missing } inserted. Because running this in isolation goes without a problem, I suspect the change has to do with the project structure in which I use the buffer. But again, it worked in the past. Does it works with \setbuffer[abc] whatever \endbuffer

Re: [NTG-context] buffer broken?

2012-01-11 Thread Meer, H. van der
. But again, it worked in the past. Does it works with \setbuffer[abc] whatever \endbuffer ? It works with these macros, yes. Thanks. But is \setbuffer..\endbuffer something new? I do not see it on the Reference page of the wiki. Also it doesn't seem in line with ConTeXt's regular naming scheme

Re: [NTG-context] buffer broken?

2012-01-11 Thread luigi scarso
with the project structure in which I use the buffer. But again, it worked in the past. Does it works with \setbuffer[abc] whatever \endbuffer ? It works with these macros, yes. Thanks. But is \setbuffer..\endbuffer something new? I do not see it on the Reference page of the wiki

Re: [NTG-context] buffer broken?

2012-01-11 Thread Wolfgang Schuster
in which I use the buffer. But again, it worked in the past. Does it works with \setbuffer[abc] whatever \endbuffer ? It works with these macros, yes. Thanks. But is \setbuffer..\endbuffer something new? No, it’s a old command but not very useful for a user. I do not see

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 3-11-2011 23:01, Stefan Müller wrote: \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable} \starttext \Works \stopxtable %\Doesnt \stoptext \def\test {\setbuffer[demo] \startxtable \startxrow \startxcell

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Thomas A. Schmitz
On 11/4/11 10:38 AM, Hans Hagen wrote: \def\test {\setbuffer[demo] \startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable \endbuffer \processxtablebuffer[demo]} Hans, is the solution to my xml problem along

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 4-11-2011 11:11, Thomas A. Schmitz wrote: On 11/4/11 10:38 AM, Hans Hagen wrote: \def\test {\setbuffer[demo] \startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable \endbuffer \processxtablebuffer[demo]} Hans, is the solution to my xml problem along these lines

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Stefan Müller
On 3-11-2011 23:01, Stefan Müller wrote: \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable} \starttext \Works \stopxtable %\Doesnt \stoptext \def\test {\setbuffer[demo] \startxtable \startxrow

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 4-11-2011 18:18, Stefan Müller wrote: On 3-11-2011 23:01, Stefan Müller wrote: \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable} \starttext \Works \stopxtable %\Doesnt \stoptext \def\test {\setbuffer[demo

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Wolfgang Schuster
([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],44,above);text([3.5,2],44,right);stroke=red;fontfill=red;line([1,0],[1,4]);text([1,2],?,right);' / Write the whole block to a external file and read import it them with \externalfigure. \startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Hans Hagen
\setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups remind me to make a \xmltofile some time - Hans Hagen | PRAGMA ADE

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Anand Raj
],[1,4]);text([1,2],?,right);' / Write the whole block to a external file and read import it them with \externalfigure. \startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups remind me to make

Re: [NTG-context] buffers and expansion order

2010-12-13 Thread Wolfgang Schuster
Am 13.12.2010 um 12:04 schrieb Yury G. Kudryashov: Hi! Why the following doesn't work? \def\mybuf{\startbuffer[a]b\stopbuffer} \def\mybuf{\setbuffer[a]b\endbuffer} Wolfgang ___ If your question

Re: [NTG-context] vbox construct breaking MKII

2010-08-04 Thread Hans Hagen
is already there. \type parses the contents correctly, and \startbuffer writes it to an external file. Something that combines the two will be great. Such a feature will be handy for inline syntax highlighting with the t-vim module. \setbuffer[bla]more bla\endbuffer

Re: [NTG-context] vbox construct breaking MKII

2010-08-04 Thread Aditya Mahajan
highlighting with the t-vim module. \setbuffer[bla]more bla\endbuffer That does not work in mkii and does not look right for the user interface. For pretty printing using the inbuilt macros, one can use \startTEX \stopTEX and \typeTEX{...} Normally, I want the display version to insert blank

Re: [NTG-context] from latex pstricks to context

2009-07-13 Thread luigi scarso
}} {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}} for \startTEXapplication see page-app.tex \long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication {\bgroup \bgroup \let\f!temporaryextension\c!tex \setbuffer[\@@texapp]% \starttext #2% preamble

Re: [NTG-context] \setbuffer

2009-05-10 Thread Wolfgang Schuster
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined as \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang

Re: [NTG-context] \setbuffer

2009-05-10 Thread Hans Hagen
Wolfgang Schuster wrote: Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined as \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? no need as \dosetbuffer is defined as \long and \setbuffer

Re: [NTG-context] \setbuffer

2009-02-24 Thread Wolfgang Schuster
On Sat, Feb 14, 2009 at 10:09 AM, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Hi Hans, why is \setbuffer not defined with \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang

Re: [NTG-context] \setbuffer

2009-02-19 Thread Wolfgang Schuster
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined with \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang

[NTG-context] \setbuffer

2009-02-14 Thread Wolfgang Schuster
Hi Hans, why is \setbuffer not defined with \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang ___ If your question is of interest to others

Re: [NTG-context] creating environments

2007-02-05 Thread Wolfgang Schuster
this: \starttext \placefigure {} {\startbuffer{mybuffer} Floating text from a buffer \stopbuffer \getbuffer{mybuffer}} \stoptext with content saved in a buffer. no, there is \setbuffer but in general (at least not in context mkii) buffers are to be defined at the outer level

Re: [NTG-context] creating environments

2007-01-31 Thread Hans Hagen
\getbuffer{mybuffer}} \stoptext with content saved in a buffer. no, there is \setbuffer but in general (at least not in context mkii) buffers are to be defined at the outer level It's not a real problem but I wanted to know if it is possible to define a environment in the way I wanted

Re: [NTG-context] creating environments

2007-01-31 Thread Wolfgang Schuster
with content saved in a buffer. no, there is \setbuffer but in general (at least not in context mkii) buffers are to be defined at the outer level It's not a real problem but I wanted to know if it is possible to define a environment in the way I wanted. Hi Hans, I looked into core-buf

Re: [NTG-context] LilyPond module for LilyPond 2.9.x

2006-10-03 Thread Henning Hraban Ramm
{% \egroup% from \dostartlilypond \bgroup% %... \global\advance\lily!figures\plusone \startmode[*\v!first]% \def\obeyedlines{\string^^J}% \convertargument#2\to\ascii \expanded{% \setbuffer[lilypond-\the\lily!figures]% % here it works, all buffers are numbered % ... \ascii

Re: [NTG-context] LilyPond module for LilyPond 2.9.x

2006-10-03 Thread Mojca Miklavec
\dodostartlilypond[#1]#2\stoplilypond{% \egroup% from \dostartlilypond \bgroup% %... \global\advance\lily!figures\plusone \startmode[*\v!first]% \def\obeyedlines{\string^^J}% \convertargument#2\to\ascii \expanded{% \setbuffer[lilypond-\the\lily!figures

Re: [NTG-context] counting the words in a TeX document

2006-08-07 Thread Mojca Miklavec
\startstatistics {\dodoubleempty\dostartstatistics} \def\dostartstatistics[#1][#2]#3\stopstatistics {\setbuffer[#1]#3\endbuffer \executesystemcommand{ruby wordcount.rb \jobname-#1.tmp}% \getbuffer[#1]} \protect \doifnotmode{demo}{\endinput} ... but a friend who asked me for a favour actually

Re: [NTG-context] t-rsteps and starttyping

2005-09-22 Thread Christopher Creutzig
\doStartLong} \egroup \def\doStartLong#1\StopLong{% \setbuffer[x]#1\endbuffer \endgroup \getbuffer[x] } \starttext \StartLong \starttyping abcde \stoptyping and now for something completely different \StopLong \stoptext Christopher ___ ntg-context

Re: [NTG-context] t-rsteps and starttyping

2005-09-22 Thread David Munger
this: \bgroup \catcode`\^^M=\active \gdef\StartLong{\begingroup\obeylines\let^^M^^J\doStartLong} \egroup \def\doStartLong#1\StopLong{% \setbuffer[x]#1\endbuffer \endgroup \getbuffer[x] } \starttext \StartLong \starttyping abcde \stoptyping and now for something completely